package com.zhuozhou.jdyc.main.meinfo.activity;

import android.content.Intent;
import android.os.Bundle;

import com.zhuozhou.jdyc.R;
import com.zhuozhou.jdyc.api.UserAccountHelper;
import com.zhuozhou.jdyc.base.BaseActivity;
import com.zhuozhou.jdyc.databinding.ActivityDistributionBinding;
import com.zhuozhou.jdyc.main.meinfo.viewmodel.MeInfoViewModel;
import com.zhuozhou.jdyc.util.log.ToastUtils;

/**
 * Create by Once_ChuXy on 2021/10/8
 * Describe:分销中心
 */
public class DistributionActivity extends BaseActivity<MeInfoViewModel, ActivityDistributionBinding> {
    @Override
    protected int getLayoutId() {
        return R.layout.activity_distribution;
    }

    @Override
    public String setTitleBar() {
        return "分销中心";
    }

    @Override
    public void initView() {
        mViewModel.BasicsFenXaoMoneyMutableLiveData.observe(this, v -> {
            binding.setInfo(v);
            binding.setUser(UserAccountHelper.getUser());
        });
        binding.llOrder.setOnClickListener(v -> {
            Intent in = new Intent(this, DistributionOrderActivity.class);
            startActivity(in);
        });
        binding.llDetail.setOnClickListener(v -> {
            Intent in = new Intent(this, DistributionDetailActivity.class);
            startActivity(in);
        });
        binding.llMembers.setOnClickListener(v -> {
            Intent in = new Intent(this, DistributionVipActivity.class);
            startActivity(in);
        });
        binding.tvSettlement.setOnClickListener(v -> {
            ToastUtils.showShort("开发中");
//            Intent in = new Intent(this, DistributionVipActivity.class);
//            startActivity(in);
        });
    }

    @Override
    public void initData(Bundle bundle) {
        mViewModel.getFenXaoMoney(UserAccountHelper.getUserID() + "");
    }
}
